import request from '@/utils/request'

// 获取所有权限列表
export function getAllJurisdiction() {
  return request({
    url: 'Jurisdiction/selectAllJurisdiction',
    method: 'get'
  })
}
// 根据jurisdiction_id获取当前权限名称
export function getJurisdictionName(jurisdictionId) {
  return request({
    url: 'Jurisdiction/selectByPrimaryKey',
    method: 'get',
    params: { jurisdictionId: jurisdictionId }
  })
}
// 根据jurisdiction_id修改当前权限名称
export function updateJurisdictionName(jurisdictionName, jurisdictionId) {
  return request({
    url: 'Jurisdiction/updateByPrimaryKey',
    method: 'put',
    params: {
      jurisdictionName: jurisdictionName,
      jurisdictionId: jurisdictionId
    }
  })
}
// 添加jurisdiction
export function addJurisdictionName(jurisdictionName, jurisdictionId) {
  return request({
    url: 'Jurisdiction/insert',
    method: 'POST',
    params: {
      jurisdictionId: jurisdictionId,
      jurisdictionName: jurisdictionName
    }
  })
}
// 根据jurisdiction_id删除当前权限（谨慎使用）
export function delJurisdictionName(jurisdictionId) {
  return request({
    url: 'Jurisdiction/deleteByPrimaryKey',
    method: 'DELETE',
    params: { jurisdictionId: jurisdictionId }
  })
}
